#include <Arduino.h>

#include "scheduler_basic.hpp"
#include "scheduler_tick.hpp"

using TimeSource = scheduler_basic::ArduinoMsSource;
using TimeType = uint32_t;

scheduler_basic::DelayCallback3<TimeSource, 10> dcb;

// ======================= MAIN ======================

TimeType test() {
    Serial.print("HELLO HELLO\n");
    return 800;
}


class Executor : public scheduler_basic::TaskObject<Executor, TimeType> {
    public:
    TimeType task() {
        Serial.print("OBJECT!\n");
        return 500;
    }

};

void setup() {
    Serial.begin(115200);

    Executor e;

    dcb.add_task(&e, 0);
    dcb.add_task(test, 0);

    while (1) {
        dcb.tick();
        
        // Serial.print("TICKED\n");
        delay(100);
    }
}


void loop() { /* DO NOTHING */ }